﻿/*
* 创建人:            @Model.Author
* 创建时间:          @Model.CreateTime
* 邮箱：             @Model.EmailAddress
* 文件功能描述：      @Model.FileRemark
* 
* 修改人： 
* 时间：
* 修改说明：
*/
@using System
@using SJNScaffolding.WPF.Extend
@model SJNScaffolding.Models.TemplateModels.ViewFileModel
using System;
using Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace @(Model.ProjectName).Domain.Plat.@(Model.TableName)s
{
    public class @Model.TableName : FullAuditedEntity<@(Model.IdType)>
    {
        @foreach (var item in Model.TypeColumnNames)
        {
@("     ///" )<summary>
@("     ///" + item.Comments) 
@("     ///" )</summary>
    if(item.IsRequired=="1")
    {
@RazorHelper.RawHtml("      [Required(ErrorMessage=\""+item.Comments+"为必填项\")] \r\n")
    }
    if(item.IsVarchar)
     {
@RazorHelper.RawHtml("      [StringLength(" + item.DataLength + ",ErrorMessage=\""+item.Comments+"的长度应在"+item.DataLength + "字符以内\")]\r\n")
     }
@RazorHelper.RawHtml("     public " + item.AttrType + " " + item.ColumnName + "{get;set;} \r\n")
        }
    }
}